<template>
  <div>
        <div class="panel panel-primary">
          <div class="panel-heading" style="background-color: #444A5A;padding: 0px;border: 1px #444A5A solid">
            <div class="row" style="margin-top: 15px;margin-bottom: 10px">
              <div class="col-xs-2 col-lg-2 text-center">
               <img src="../../assets/jcd.png" style="height: 30px;width: 30px;">
                <div style="font-size: 15px">至诚失物招领平台</div>
              </div>
                <div class=" col-xs-1.25 col-lg-1.25" style="margin-top: 13px; font-size: 15px; margin-left: 20px;" v-for="menu in Menu">
                  <router-link :to="menu.url"><span class="glyphicon glyphicon-th-large">{{menu.pname}}</span></router-link>
                </div>
              <div class="col-xs-2 text-right col-lg-2"  style="margin-top: 15px;font-size: 15px;">
                <router-link to="/login">
                  <span class="glyphicon glyphicon-log-out"></span> &nbsp;
                  退&nbsp;&nbsp; 出
                </router-link>
              </div>
            </div>
          </div>
        </div>
  </div>
</template>

<script>
  import axios from 'axios'
    export default {
      name: "headerComponent",
      props:['account'],
      data(){
          return {
            Menu:[],
          }
      },
      created() {
        var self = this
        if (window.sessionStorage.getItem("stuNo")==null){
          this.$router.push({
            path: this.$route.query.redirect || 'login'
          })
        }

      },
      beforeCreate() {
        var self = this
        axios
          .get(this.rootUrl+"/permission/QueryPermision",
            {
              params:{stuNo:window.sessionStorage.getItem("stuNo")}
            })
          .then(function (resp) {
            self.Menu=resp.data
          })
      }
    }
</script>

<style scoped>
  a{
    color:white;
  }
  a:hover{
    color: #CECECE;
  }
  /*a:active{*/
  /*  color:#FFFFFF;*/
  /*}*/
  /*a:link{*/
  /*  color: #F45809;*/
  /*}*/
</style>
